#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class Solution {
public:
	int maximumProduct(vector<int>& nums) {
		sort(nums.begin(), nums.end(), less<int>());
		int a = nums[nums.size() - 1]* nums[nums.size() - 2]* nums[nums.size() - 3];
		int b = nums[0] * nums[1] * nums[nums.size() - 1];
		return a>b?a:b;
	}
};
int main() {
	Solution s;
	vector<int> a = { 1,2,3 };
	cout << s.maximumProduct(a);

}